package com.asialjim.wechat.spring.config.db;

import com.baomidou.mybatisplus.core.injector.AbstractMethod;
import com.baomidou.mybatisplus.core.injector.AbstractSqlInjector;
import com.baomidou.mybatisplus.core.injector.methods.*;
import java.util.List;
import java.util.stream.Stream;
import static java.util.stream.Collectors.toList;

/**
 * <h2><em>ASIAL JIM JAVA DOC</em></h2><hr/>
 * <h3>CLASS DESCRIPTION</h3><strong>
 * <p> sql注入器，用于mybatisPlus自动生成sql语句并注入到mapper中
 * </strong><p><p><em> Copyright &copy; ztzh inc Ztzh Co., LTD</em><hr/>
 * @author Asial Jim &nbsp;&nbsp; Email: <a href="mailto:zengyz0128@zsmarter.com">ZSMARTER邮箱</a> &nbsp;&nbsp; <a href="mailto:asialjim@hotmail.com">HOTMAIL邮箱</a>
 * @since 2021/1/13 9:37 &nbsp; JDK 1.8
 * @version 1.0.0
 */
public class ApplicationSqlInjector extends AbstractSqlInjector {

    /**
     * <h4>METHOD DESCRIPTION</h4>
     * 获取自动生成sql语句的方法列表
     * @return {@link List< AbstractMethod>}
     * @author Asial Jim &nbsp;&nbsp; Email: <a href="mailto:zengyz0128@zsmarter.com">ZSMARTER邮箱</a> &nbsp;&nbsp; <a href="mailto:asialjim@hotmail.com">HOTMAIL邮箱</a>
     * @since 2021/1/13 9:40
     */
    @Override
    public List<AbstractMethod> getMethodList(Class<?> mapperClass) {
        return Stream.of(
                new ApplicationInsert(),// 使用可插入数据库时间的sql插入语句生成器
                new Delete(),
                new DeleteByMap(),
                new DeleteById(),
                new DeleteBatchByIds(),
                new ApplicationUpdate(),// 使用可更新数据库时间的sql更新语句生成器
                new ApplicationUpdateById(),// 使用可更新数据库时间的sql更新语句生成器
                new SelectById(),
                new SelectBatchByIds(),
                new SelectByMap(),
                new SelectOne(),
                new SelectCount(),
                new SelectMaps(),
                new SelectMapsPage(),
                new SelectObjs(),
                new SelectList(),
                new SelectPage()
        ).collect(toList());
    }
}
